package com.example.learn.red_black_tree;

public class RedBlackTree extends BinarySearchTree implements Tree{

    @Override
    public Node insert(int e) {
        Node newNode = super.insert(e);
        newNode.right = nilNode;
        newNode.left = nilNode;
        root.parent = nilNode;
        fixInsertBalance(newNode);
        return newNode;
    }

    private void fixInsertBalance(Node current) {
        while(current.parent!=root && current.parent.color== Node.Color.RED){

        }
    }
}
